package testenum;

public enum testEnum {
    RED(1,"red"),
    BLACK(2,"black"),
    GREEN(3,"green");

    private String color;
    private int ordinal;

    testEnum(int ordinal,String color){
        this.color=color;
        this.ordinal=ordinal;
    }

    public static void main(String[] args) {
        testEnum color=RED;
        switch (color){
            case RED:
                System.out.println("RED");
                break;
            case BLACK:
                System.out.println("BLACK");
                break;
            case GREEN:
                System.out.println("GREEN");
                break;
            default:
                System.out.println("color error");
                break;
        }
    }
}
